	// NumberInput 数值输入
	var NumberInput=function(selector){
		if(typeof selector=="undefined"){
			return ;
		}
		this.selector=selector;
		this.init();
	}
	NumberInput.prototype=new Control();
	NumberInput.options={
		valueReg:"^((([1-9]\\d*)|0)(\\.\\d{1,2})?)$",
		valueRegNotFitTips:"请输入数值格式",
		
		minValue:"",
		minValueNotFitTips:"不得小于{value}",
		
		maxValue:"",
		maxValueNotFitTips:"不得大于{value}",
		
		minSelector:"",
		minSelectorNotFitTips:"不得小于最小值",
		
		maxSelector:"",
		maxSelectorNotFitTips:"不得大于最大值"
	}
	NumberInput.prototype.init=function(){
		this.element=$(this.selector).get(0);
		$(this.element).prop("type","text");
		
		var self=this;
		$(this.element).bind("change",function(event){
			self.changeHandle(event);
		})
		$(this.element).bind("input",function(event){
			self.element.value = self.element.value.replace(/[^\d\.]/g,'');
		})
		this.options=this.getOptions();
	}
	NumberInput.prototype.getOptions=function(){
		var optionsStr=this.element.getAttribute("data-options")
		var options=null;
		if(optionsStr==null){
			options={}
		}else{
			options=eval("({"+optionsStr+"})");
		}
		options=$.extend({},NumberInput.options,options);
		return options;
	}
	NumberInput.prototype.changeHandle=function(event){
		var element=event.currentTarget;
		var value=element.value;
		if(!this.checkValue(value)){
			element.value="";
		};
	}
	NumberInput.prototype.checkValue=function(value){
		if(value==""){
			return true;
		}
		var reg="";
		reg=this.options.valueReg;
		
		var regExp=new RegExp(reg);
		if(!regExp.test(value)){
			var tips=this.options.valueRegNotFitTips;
			alert(tips);
			return false;
		}
		//最大元素限制
		if(this.options.maxSelector!=""){
			var maxValue=$(this.options.maxSelector).val();
			if(maxValue!=""){
				if(maxValue<value){
					var tips=this.options.maxSelectorNotFitTips;
					alert(tips);
					return false;
				}
			}
		}
		//最小元素限制
		if(this.options.minSelector!=""){
			var minValue=$(this.options.minSelector).val();
			if(minValue>value){
				var tips=this.options.minSelectorNotFitTips;
				alert(tips);
				return false;
			}
		}
		//最大值限制
		var maxValue=this.options.maxValue;
		if(maxValue!=""){
			if(maxValue<value){
				var tips=this.options.maxValueNotFitTips;
				tips=tips.replace("{value}",maxValue)
				alert(tips);
				return false;
			}
		}
		//最小值限制
		var minValue=this.options.minValue;
		if(minValue!=""){
			if(minValue>value){
				var tips=this.options.minValueNotFitTips;
				tips=tips.replace("{value}",minValue)
				alert(tips);
				return false;
			}
		}
		return true;
	}
	NumberInput.prototype.reset=function(){
	}
	HTMLTurbo.control.NumberInput=NumberInput;